package descentFly.app.dialogs
{
	import descentFly.app.df_block;
	import descentFly.app.df_modalLayer;
	
	import flash.events.Event;
	
	public class df_question extends df_alert {
		private var _okFunc: Function;
		public function df_question(a_parent:df_modalLayer, message:String, okFunc: Function, styleClass:Object='window') {
			super(a_parent, message, styleClass, 2);
			_okFunc = okFunc;
		}
		
		private function doYes(e: Event): void {
			close();
			_okFunc(true);
		}
		
		private function doCancel(e: Event): void {
			close();
			_okFunc(false);
		}
		
		override protected function createButtons(a_layer: df_block):void {
			addButton(locale.YES, doYes);
			addButton(locale.CANCEL, doCancel);
		}
	}
}